package com.softstao.guoyu.mvp.interactor.me;

import com.softstao.guoyu.global.APIInterface;
import com.softstao.guoyu.model.me.AuditApplyCondition;
import com.softstao.guoyu.model.me.AuditDetail;
import com.softstao.guoyu.model.me.AuditInfo;
import com.softstao.guoyu.mvp.interactor.BaseInteractor;
import com.softstao.guoyu.utils.MyHttpParams;

import rx.functions.Action1;

/**
 * Created by vaikus on 2017/6/15.
 */

public class AuditInteractor extends BaseInteractor {
    public void getAuditInfo(int agentId, Action1<Object> action1){
        MyHttpParams params = new MyHttpParams("agentId", agentId);
        builder.setAction(action1)
                .setUrl(APIInterface.AUDIT_INFO)
                .setType(AuditInfo.class)
                .getVolley()
                .post(params);
    }

    public void addAudit(AuditApplyCondition condition,Action1<Object> action1){
        MyHttpParams params = new MyHttpParams(condition);
        builder.setAction(action1)
                .setUrl(APIInterface.AUDIT_ADD)
                .setType(null)
                .getVolley()
                .post(params);
    }

    public void getAuditDetail(int agentId, int processId, Action1<Object> action1){
        MyHttpParams params = new MyHttpParams("agentId",agentId,"processId",processId);
        builder.setAction(action1)
                .setUrl(APIInterface.AUDIT_DETAIL)
                .setType(AuditDetail.class)
                .getVolley()
                .post(params);
    }

    public void cancel(int agentId, int processId, Action1<Object> action1){
        MyHttpParams params = new MyHttpParams("agentId",agentId,"processId",processId);
        builder.setAction(action1)
                .setUrl(APIInterface.CANCEL_APPLY)
                .setType(null)
                .getVolley()
                .post(params);
    }
}
